<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="发送信息" id="sendBtn">
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script src="lib/web/websocket/Webscoket.reconnect.js"></script>
<script src="lib/web/websocket/TioUtils.js"></script>
<script src="lib/web/websocket/TioCommand.js"></script>
<script>
    var config ={
        "url":"ws://123.207.167.163:9010/ajaxchattest",
        "onOpenEvent":function(ws){
            console.log("连接上了服务器了:"+ws);
        },
        "onMessageEvent":function(ws,resp){
            console.log("接受到了信息了:"+resp)
        },
        "onSendMsgEvent":function(ws){
            console.log("发送信息")
            ws.send("我是测试信息");
        }
    }
    var tio = new TioUtils(config);
    $("#sendBtn").click(function () {
        tio.sendMsg();
    })
</script>
</body>
</html>